<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pGrid.jsp" %>
<title>用户选择</title>
<script>
	var dialog = null,data = {singleSelect: false};  
	$(function(){
		dialog =  frameElement.dialog, data = dialog.dialog("get","data") || data ;
		var gridParam = {
			singleSelect:  data.singleSelect || false ,
			queryParams: {
				companyStatus: 0,
				companyStatus_searchType: "eq"
			},
			columns : [[ 
			     { "field" : "account", "width" : 120, "title" : "用户账号" }, 
			     { "field" : "nickName", "width" : 80, "title" : "姓名" } ,
			     {"field":"companyName","width":150,"title":"单位名称"},
				 {"field":"companyStatus","width":70,"title":"单位状态",formatter:function(val){
					return val =="0" ? "<b style='color:green;'>正常</b>" : "<b style='color:red;'>禁用</b>";
				 }},
				 {"field":"smsBalance","width":120,"title":"短信余额"},
				 {"field":"smsSignature","width":120,"title":"短信签名"},
				 {"field":"smsExtCode","width":80,"title":"短信扩展码"}
			]]
		};
		p.dataGrid = $(p.dataGrid).datagrid( $.extend(true, {}, p.dataGridParam,gridParam));

		/*事件响应*/
		$("#buttons .easyui-linkbutton").on("click", function() {
			var motion_code = $(this).attr("motion_code");p.btnOneClick($(this));
			switch (motion_code) {
				case "05": p.gridQuery(); break;
				default: break;
			}
		});
	});
	
	/*窗口确认回调方法*/
	function choose(){
		return p.dataGrid.datagrid('getSelections');
	}
</script>
</head>
<body class="easyui-layout">
	<!-- 但行高度33px，多行时 33乘以行数  -->
	<div data-options="region:'north',split:false,border:false" style="height:33px;">
		<div class="easyui-panel" data-options="fit:true,border:false">
			<!-- 查询条件表单，根据配置进行替换  -->
			<form id="queryForm" >
			 <input type="hidden" name="className" value="com.fs.base.pojo.User" />
			 <div style="margin-top:5px;margin-left:10px;float:left;">
			  	<input class="easyui-textbox" name="nickName" style="width:240px;" data-options="label:'姓名:',required:false" />
				<input type="hidden" name="nickName_searchType" value="like" />
			 </div>
			 <div style="margin-top:5px;margin-left:10px;float:left;">
				  <input class="easyui-textbox" name="companyName" style="width:240px;" data-options="label:'单位名称:',required:false" />
				<input type="hidden" name="companyName_searchType" value="like" />
				 </div>
			 <div id="buttons" style="margin-top:5px;margin-left:10px;float:left;">
			 	<a href="#" class="easyui-linkbutton" iconCls="icon-search" motion_code="05" plain="true">查询</a>
			 </div>
			</form>
		</div>
	</div>  

	<!-- 表格 -->
	<div region="center" border="false">
		<table id="dataGrid"></table>
	</div>
</body>
</html>